package com.tongji.housediy.controller.CantavilCMD
{
	import com.tongji.housediy.events.CantavilEvent.GetAllCityEvent;
	import com.tongji.housediy.events.brandEvent.GetAllBrandEvent;
	import com.tongji.housediy.model.CantavilModel;
	import com.tongji.housediy.service.CantavilService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author kevin
	 * 2011/5/06
	 */ 
	public class GetAllCitysCommand extends Command
	{
		[Inject]
		public var service:CantavilService;
		
		[Inject]
		public var event:GetAllCityEvent;
		
		[Inject]
		public var model:CantavilModel;
		
		override public function execute():void
		{
			switch(event.type)
			{
				case GetAllCityEvent.GET_ALL_CITYS:
					service.getCity();
					break;
				case GetAllCityEvent.UPDATE_CITY_LIST:
					model.updateCityModel(event.citysArray);
					break;
			}
		}
	}
}